﻿<script type="text/javascript">
    $(function () {
        getButton("hzBaseSectionBy");
    });

    function ui_hzBaseSectionBy_init_list(toolbar) {
        $("#ui_hzBaseSectionBy_dg").datagrid({       //初始化datagrid
            url: "ashx/bg_hzBaseSectionBy.ashx?action=getall",
            striped: true, rownumbers: true,
            singleSelect: true,
            idField: 'pcode',
            sortName: 'pcode',
            sortOrder: 'asc',
            columns: [[

                { field: 'pname', title: '区域名称', width: 120 },
                { field: 'totalgraves', title: '号码总数', width: 100 },
                { field: 'occupygraves', title: '已存号总数', width: 100 },
                { field: 'emptygraves', title: '空号总数', width: 100 },
                { field: 'singlegraves', title: '单穴总数', width: 100 },
                { field: 'doublegraves', title: '双穴总数', width: 100 },
                { field: 'multigraves', title: '多穴总数', width: 100 },
                { field: 'totaldeads', title: '总容量', width: 100 },
                { field: 'storedeads', title: '已存骨灰数', width: 100 },
                { field: 'emptydeads', title: '空余容量', width: 100 }

            ]],
            rowStyler: function (index, row) {
                if (!row.pcode) {
                    return 'background-color:#6293BB;color:#fff;font-weight:bold;';
                }
            },
            footer: "#ui_hzBaseSectionBy_dg_ft"
            //toolbar: toolbar.length == 0 ? null : toolbar
            //toolbar: [{
            //    text: '导出',
            //    iconCls: 'icon-bug_go',
            //    handler: function () { ui_hzBaseSectionBy_export(); }
            //}, {
            //    text: '删除',
            //    iconCls: 'icon-bug_delete',
            //    handler: function () { ui_hzBaseSectionBy_delete(); }
            //}, {
            //    text: '回复',
            //    iconCls: 'icon-bug_edit',
            //    handler: function () { ui_hzBaseSectionBy_edit(); }
            //}]           
        });

    }
    function ui_hzBaseSectionBy_search() {
        var paradisecode = $('#ui_hzBaseSectionBy_paradise_code').combotree('getValue');
        var url = "ashx/bg_hzBaseSectionBy.ashx?action=export&paradisecode=" + paradisecode;
        $('#ui_hzBaseSectionBy_btn_export').attr("href", url + paradisecode);
        $('#ui_hzBaseSectionBy_dg').datagrid("load", { paradisecode: paradisecode });
    }

</script>
<div id="ui_hzBaseSectionBy_layout" class="easyui-layout" data-options="fit:true,border:false">   
    <div id="ui_hzBaseSectionBy_layout_center" data-options="region:'center',border:false">
        <div  id="ui_hzBaseSectionBy_layout_toolbar" class="datagrid-toolbar" style="padding: 2px 5px;">
            <input class="easyui-combotree" id="ui_hzBaseSectionBy_paradise_code" name="ui_hzBaseSectionBy_paradise_code"
                                data-options="url: 'ashx/bg_paradise.ashx?action=getall', lines:true,required:true" />
            <img style="cursor: pointer; vertical-align: middle;" onclick="$('#ui_hzBaseSectionBy_paradise_code').combotree('clear');"
                        alt="清空" title="清空" src="themes/icons/edit-clear.png" />
            <a href="javascript:void(0);" class="easyui-linkbutton" iconcls="icon-search" onclick="ui_hzBaseSectionBy_search()">查询</a>
            <a href="ashx/bg_hzBaseSectionBy.ashx?action=export" target="_blank" class="easyui-linkbutton" id="ui_hzBaseSectionBy_btn_export" iconcls="icon-export" plain="true">导出</a>            
        </div>
       
        <div id="ui_hzBaseSectionBy_layout_header" class="datagrid-header" style="text-align: center; font-weight: 600">内部基本情况汇总表</div>
        <table id="ui_hzBaseSectionBy_dg" data-options="fit:true,border:false">
        </table>
        <div id="ui_hzBaseSectionBy_dg_ft" style="height:50px"></div>
    </div>
</div>
